import type { App } from 'vue';

export function decorate(app: App) {
	const requireComponent = import.meta.glob('./components/**/*.vue', { import: 'default', eager: true });
	Object.keys(requireComponent).forEach((fileName: any) => {
		// 获取组件配置
		const componentConfig: any = requireComponent[fileName];
		app.component(
			componentConfig.name, // 此处的name,是组件属性定义的name
			componentConfig
		);
	});
}
